home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / TODO.s48-0.36 < prev    next >
Text File  |  1995-10-13  |  12KB  |  264 lines

  1. --*- Mode: Indented-text; -*-
  2.  
  3. Scheme 48: list of bugs and things to do.
  4. Last update by JAR on 3 March 1994.
  5.  
  6. Run-time system bugs:
  7.     MAX and MIN don't do inexact contagion.
  8.     Compiler needs to treat calls with more than 63 arguments specially.
  9.     Compiler loses if a procedure has more than 254 literals.  This
  10.       seems to happen a lot with enormous backquote forms, which really
  11.       do arise in practice (e.g. PSD, Hanson's macro expander, etc.).
  12.     Shadowing can fail sometimes for macro-referenced variables.  E.g.
  13.       the following sequence will lose if entered interactively as
  14.       three separate forms:
  15.         (define (foo x) `(a ,x))
  16.     (define cons list)
  17.     (foo 1) => (a (1 ()))
  18.     The WITH-**PUT-FILE and CALL-WITH-**PUT-PORT procedures probably
  19.       close ports sooner than the Scheme reports think they ought to.
  20.       (They just do the obvious DYNAMIC-WIND.)
  21.     If (find-all-symbols) fails due to lack of space, it should GC and
  22.       retry (I think) (bug reported by Basile Starynkevitch, 7-21-93)
  23.  
  24. Programming environment:
  25.     Error checking for macro & special form syntax.
  26.     Fuller on-line documentation.
  27.     Error recovery.  Can do better than ,proceed.  LOAD should set up
  28.       restart continuations.
  29.     Types in scheme-interface (and elsewhere) aren't as tight as they
  30.       could be.
  31.     LET continuation "pessimization" to retain the environment longer.
  32.     Have the disassembler display local variable names.
  33.     This ought to be recoverable, but isn't always:
  34.     > (let loop ((x '())) (loop (cons 3 x)))
  35.     not enough room in heap for stack
  36.     Put the inspector at its own command level, so that ^D after
  37.       errors puts you back in the inspector.
  38.     The get-cont-from-heap instruction should have an exception
  39.       discloser that indicates the actual error (returning a
  40.       non-fixnum from application top level).
  41.     Separate compilation (compile a module, writing object code to a
  42.       file).  (Rudiments in misc/separate.scm)
  43.     Semicolon comments don't quite work after commands (extra newline
  44.       required).
  45.     Command (and procedure) to change current directory.
  46.  
  47. Performance:
  48.     Generational GC.
  49.     More compact representation for debugging data?
  50.     Leaf procedure compilation (RK's rts/no-leaf-env.scm): if no
  51.       continuations or lambdas, skip the make-env and access locals
  52.       using stack-ref.  Expected to gain about 6% in speed.
  53.     Optimize loops somehow (maybe using call-template opcode and/or
  54.       opportunistic compilation).
  55.     The CAML light implementation has good documentation and patches
  56.       for optimizing the interpreter's switch (*pc++); perhaps we
  57.       could lift some of it.  (Range check isn't necessary.)
  58.     Floating point support in VM.
  59.     Bignum support in VM: use MIT Scheme bignums or GNU Multiple
  60.       Precision Arithmetic Library (Torbjorn Granlund <tege@sics.se>).
  61.     Faster bignum printer (e.g. the one Richard wrote - but it would be
  62.       nice if it were an option tied to bignums, not built in to the
  63.       initial image).
  64.     Ratnum multiplication and division might be made more efficient by
  65.       taking cross-GCD's.
  66.     Native code compiler...
  67.  
  68. Big Scheme features:
  69.     ,more-threads command doesn't get defined (new bug in 0.26).
  70.     How about deleting entries from tables?
  71.     Non-blocking I/O for threads.  I think access to Unix select() might
  72.       be sufficient (with pause() and sleep() as degenerate cases).
  73.       Look at concurrent ML source code, which gets this right.
  74.     RPC.
  75.     Add call/gcc (invokes the Gnu C compiler).
  76.     It would be nice if WITH-MULTITASKING returned whatever the thunk
  77.       returned.
  78.     ,exit following ,start-threads causes a core dump.
  79.  
  80. Module system bugs:
  81.     ,untrace should undefine as well if the variable wasn't bound
  82.       before.
  83.     Compound signatures don't get updated when a component signature
  84.       changes.  They contain a list of signatures with no reinitialization
  85.       thunk a la structures and packages.
  86.  
  87. Module system features:
  88.     Check for name conflicts between opened structures.
  89.     Implement interface subtraction as a way of dealing with such
  90.       conflicts: (WITHOUT (<name> ...) <interface>)
  91.     Check for cycles in structure inheritance.
  92.     An ,access command, similar to ,open.
  93.     Deal with package system state better (for linker).  Maybe each
  94.       package should point to a data structure containing
  95.       *location-uid*, location-name-table, *package-uid*,
  96.       package-name-table, and perhaps the compiler-state as well (see
  97.       segment.scm).
  98.  
  99. VM:
  100.     Heaps that can grow larger.
  101.     Add a test to configure.in that can determine whether ld -A works.
  102.       If both it and dlopen() work, then both kinds of dynamic loading
  103.       should be made available.
  104.     Merge in Olin's changes and extensions (command line processing,
  105.       the #! syntax for scripts, external function call, etc.).
  106.     Interrupt while writing out image causes an exit.  [Fixed?]
  107.     A jump-back instruction?  Might be easier to use than call-template.
  108.     Scrutinize all VM fatal errors to see if any can be recovered
  109.       from.  E.g. "out of ports" shouldn't cause a VM halt, it should
  110.       just cause open-port to return #f or an error code.  [Fixed?]
  111.     Get VM interp.scm-without-gc.scm working again.
  112.     Make the number predicate instructions return #t when appropriate
  113.       for the built-in number stored object types (bignum, double,
  114.       ratnum).
  115.     Make the Unix standard error stream available as
  116.       (error-output-port)
  117.     FIND-ALL-X-RECORDS that finds all records with a particular value
  118.       in their first slot.
  119.  
  120. Documentation:
  121.     Olin's "cig" (C interface generator).
  122.     user-guide.txt should point to the existing lsc.ps?
  123.     (optimize auto-integrate) and ,load-package analysis.
  124.     How to use the static linker.
  125.     How initial.image and scheme48.image get built, really.
  126.     Techniques for debugging the runtime system (debug/for-debugging.scm).
  127.     Threads, fluids, records, tables.  [all in big-scheme.txt?]
  128.  
  129. Cleanup:
  130.   VM:
  131.     Revert to the old exception system: vector of handlers (not just a
  132.       single procedure), and each handler gets an exception code.
  133.     Rename "unassigned" to "uninitialized"?  Or phase it out entirely.
  134.     In unix.c, use getrusage(), when available, to get run time.
  135.   Run-time / features / development environment:
  136.     A DIVIDE procedure (maybe an instruction as well) that returns two
  137.       values.
  138.     Figure out how to merge the two type systems (META-METHODS and
  139.       META-TYPES).  The generic function system could make use of the
  140.       SUBTYPE? and INTERSECT? predicates.
  141.     Correct floating point, esp. reading and printing.  And
  142.       (= 1/3 (/ 1. 3.)) returns #t, but ought to return #f.
  143.     Parameterize over file name syntax somehow.  Currently
  144.       big/filename.scm assumes Unix (cf. DIRECTORY-COMPONENT-SEPARATOR,
  145.       FILE-NAME-PREFERRED-CASE).  Perhaps there should be VM support for
  146.       this.
  147.     Make sure that the disassembler and assembler are inverses of one
  148.       another.
  149.     Disassembler should generate S-expression first, and then print
  150.       it independently.
  151.     Combine conditions, signals, and handle into a single structure?
  152.     Figure out a better way to implement ##.
  153.     Be consistent about "filename" versus "file-name".
  154.   Compiler / linker / module system:
  155.     The "reflective tower" isn't really a reflective tower, it's a
  156.       syntactic tower.  Rename it.
  157.     The scanner (file loader) should operate on streams, not lists.
  158.       This would result in more uniform and flexible internal
  159.       protocols for reading files, scanning for DEFINEs, compiling,
  160.       and running - passes could be interleaved or separated easily.
  161.     Flush link/data.scm.  Linker should instead open the VM module
  162.       that includes vm/data.scm.
  163.     Flush (optimize ...) clause in DEFINE-STRUCTURE in favor of
  164.       optimizer argument to SCAN-STRUCTURES.
  165.     Vector patterns and templates ought to be supported in
  166.       SYNTAX-RULES.
  167.     The DEFINE-INTERFACE forms should contain types for every exported
  168.       variable; the code in cprim.scm (and recon.scm?) shouldn't have
  169.       to worry about setting up types.
  170.     Add ENVIRONMENT-DEFINED? ?
  171.     Make USUAL-TRANSFORM return a transform?
  172.     Add enough to the node signature to make it usable on its own?
  173.     make-c-header-file should put definitions for the interrupt
  174.       enumeration into scheme48.h, and unix.c et al should use them.
  175.   Etc:
  176.     Start using a source control system (like rcs).
  177.     We ought to have a test system / validation suite.
  178.     There ought to be a sanity check to ensure that the size of the
  179.       area as computed by static.scm agrees with the size as computed
  180.       by C's sizeof() operator.
  181.  
  182. What should (syntax-rules (x) ((foo ?body) (let ((x 1)) ?body))) do?
  183.  
  184.  
  185. To: jar@cs.cornell.edu
  186. Subject: Not a bug this time. :-)
  187. Date: Tue, 22 Feb 94 19:13:37 -0500
  188. From: Paul Stodghill <stodghil@cs.cornell.edu>
  189.  
  190. The result of ,expand can be confusing. In particular, it doesn't
  191. distinguish between different identifiers that have the same name.
  192.  
  193. For instance, in the example below, it would be more useful if the result
  194. of the ,expand was something like,
  195.  
  196.     '((lambda (.x.1) (set! x (- .x.1))) x)
  197.  
  198. Welcome to Scheme 48 0.31 (made by jar on Sun Feb 13 18:33:57 EST 1994).
  199. Copyright (c) 1993, 1994 by Richard Kelsey and Jonathan Rees.
  200. Please report bugs to scheme-48-bugs@altdorf.ai.mit.edu.
  201. Type ,? (comma question-mark) for help.
  202. > (define-syntax foo
  203.     (syntax-rules ()
  204.       ((foo var) ((lambda (x) (set! var (- x))) var))))
  205. > (define x 1)
  206. > ,expand (foo x)
  207. '((lambda (x) (set! x (- x))) x)
  208.  
  209.  
  210.  
  211. Date: Mon, 14 Jun 93 18:33:30 HKT
  212. From: shivers@csd.hku.hk
  213. To: kelsey@flora.ccs.neu.edu
  214. Cc: jar@cs.cornell.edu
  215. Subject: Scheme 48
  216.  
  217. ...
  218. All true.  My major motivation was portability. I also found the module system
  219. to be a big win. Other things that influenced me were (1) elegance and
  220. modularity -- I felt I could comprehend and mung the system as needed (2)
  221. reasonable efficiency and small size and (3) real, full R4RS+ support (most
  222. small systems do it partly).
  223.  
  224. Actually, I wouldn't say the programming environment is particularly
  225. exceptional, unless you count the module system.
  226.  
  227. A small thing lacking in other Schemes that really reduced my debug times: the
  228. loader would complain about undefined free var refs in my code. This
  229. frequently picked out variable spelling errors, inconsistent name linkages,
  230. and forgotten procedure defs. Not a big thing, but really effective.
  231.  
  232. Another win was simply having the implementors around for detailed
  233. explanations and support.
  234.  
  235. Problems I had with S48: 
  236. - Inability to mess with the VM, as it is written in a language that can
  237.   be compiled by only 1 person in the world.
  238.  
  239. - The foreign-function support was quite limited, and the foreign-data support
  240.   was basically non-existent. Exporting gc'd data to C, gc'ing data allocated
  241.   in C, hooks into the GC, importing C data into Scheme -- no support.  Elk
  242.   handles this better, as that is critical to the type of applications at
  243.   which elk is targeted.
  244.  
  245.   I fixed some of this myself -- helped by your general, portable low-level ff
  246.   interface, which was well-designed in terms of those goals -- but I couldn't
  247.   do much about foreign-data support.
  248.  
  249. - No support currently for linking static heap data into a text-pages
  250.   area to reduce gc copying and shrink the dynamic heap.
  251.  
  252. - The module system was frequently frustrating. The non-uniform , command 
  253.   language, bugs, the restrictions of living with a module system,
  254.   being blocked from accessing primitives whose bindings had been
  255.   gc'd away at link time, and awkwardnesses in the user interface really
  256.   slowed me down.
  257.  
  258.   The module system was also a great help; these are simply the problems
  259.   of life with an experimental system, as opposed to a polished final
  260.   product.
  261.  
  262. [But] all in all, S48 was the best choice I could have made.  
  263.